package spring.demo.security.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import spring.demo.security.entity.test.Student;

import java.util.List;

/**
 * Created by td on 2017/10/13.
 */
public interface StudentRepository extends JpaRepository<Student,Integer> {

      List<Student> findBySchool_Id(Integer id);

      Student findById(Integer id);

      //不符合规范也可以通过@query注解写查询
      @Query("select p from  Student p where p.id=?1")
      Student findByIqwe(Integer id);



}
